home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / burnout.arc / BURNOUT.DOC < prev    next >
Text File  |  1985-11-28  |  26KB  |  568 lines

  1.                                                       V2.01 22-Mar-1985
  2.  
  3.                            Burnout II Documentation
  4.                            ------------------------
  5.  
  6.         Function
  7.         --------
  8.         Burnout is an enhanced version of the old screen blanking
  9.         program of the same name; its primary purpose is to blank out
  10.         your video display after a specified length of time.  This new
  11.         version is signifcantly enhanced over the older program; not
  12.         only does it allow you better control over its operations, but
  13.         it is written as a virtual device driver so that you can control
  14.         it directly from your own programs.
  15.  
  16.  
  17.         V2.01 Notes
  18.         -----------
  19.         The status report has been changed to be consistent with the
  20.         format of input parameters.  The new status report is:
  21.  
  22.                 count,reset,B,C+,V+,H+
  23.  
  24.         Note that count and reset have been reversed.  This makes it
  25.         possible to reset burnout's parameters by passing its own report
  26.         back to it, beginning with the first character of the reset
  27.         count.  (The "B" will be ignored because it's not a valid
  28.         parameter.)
  29.  
  30.         There is also a burnout "R" command which was present but not
  31.         documented in version 2.00.
  32.  
  33.         There was an error in the V2.00 documentation, in which it was
  34.         stated that you must send a "#" to BRNDEV to prepare it for a
  35.         status request.  This is not correct; the "@" flush character is
  36.         sufficient.  This error also cause the first BASIC demo program
  37.         in the TRICKS section to malfunction.  Line 40, which was
  38.  
  39.                 40 PRINT #1,"@#";
  40.  
  41.         should have been
  42.  
  43.                 40 PRINT #1,"@";
  44.  
  45.  
  46.         Installation
  47.         ------------
  48.         To install burnout, follow two steps: place the file BURNDEV.SYS
  49.         in the root directory of your boot diskette or hard disk, and
  50.         modify the CONFIG.SYS file to include the statement
  51.         "device=burndev.sys".
  52.  
  53.         In case you are not familiar with CONFIG.SYS: this is a small
  54.         text file which DOS reads when booting.  It contains various
  55.         pieces of information which DOS and other programs can use when
  56.         setting themselves up.  Look in the root directory of your boot
  57.         disk for the file CONFIG.SYS.  If no such file exists, just
  58.         type:
  59.  
  60.                 copy con \config.sys<Enter>
  61.                 device=burndev.sys<Enter>
  62.  
  63.         Then press Ctrl-Z (you'll see "^Z") and <Enter>, and you're
  64.         done.
  65.  
  66.         If you already have a CONFIG.SYS file (which is likely), you
  67.         must edit it to include the statement "device=burndev.sys".  Do
  68.         this using your text editor or word processor in text mode (or
  69.         Edlin, heaven forbid).  Retain all existing information, and add
  70.         the new line.
  71.  
  72.         WARNING: version 2.0 is experimental.  Don't install burnout on
  73.         your only bootable disk.  There's always a chance something will
  74.         go wrong go wrong go wrong, and you can't delete the CONFIG.SYS
  75.         or BURNDEV.SYS files unless you can boot the machine.
  76.  
  77.         Now reboot your machine.  If all goes well, it will boot as
  78.         usual.  There will be no indication that anything has happened.
  79.         However, the screen should blank out after about ten minutes of
  80.         inactivity.
  81.  
  82.  
  83.         Burnout parameters
  84.         ------------------
  85.         There are several ways in which you can alter the operation of
  86.         burnout.  There is a demo program called BURNOUT.COM which you
  87.         can use for this purpose.  Its syntax is as follows:
  88.  
  89.                 burnout [count] [V+-] [H+-] [C+-]
  90.  
  91.         The parameters are as follows:
  92.  
  93.         COUNT: changes the number of clock ticks until the screen
  94.         blanks (this is called the "reset count").  For example,
  95.  
  96.                 burnout 5000
  97.  
  98.         sets the reset count to 5000.  This means that if burnout
  99.         observes no keyboard or video activity within 5000 clock
  100.         ticks, it will blank the screen.  On the IBM PC, there are
  101.         about 18.2 ticks per second, so this means that the screen will
  102.         clear after about 5000/18.2 seconds (275 seconds, or about four
  103.         and a half minutes).  (The default value on powerup is 10800
  104.         ticks, or about 10 minutes).  You can set the reset count
  105.         anywhere from 1 tick (not highly recommended) to 65535 ticks
  106.         (about an hour).
  107.  
  108.         If you set the reset count to 0, burnout will be effectively
  109.         "deinstalled" (equivalent to the old BURNOUT /Q) until you set a
  110.         new nonzero count.  This is useful for programs that don't get
  111.         along with the screen blanker.
  112.  
  113.         V: This stands for Video, and tells burnout whether you want it
  114.         to monitor video activity in adddition to keyboard activity.
  115.         You can set either "V+" (monitor video), or "V-" (don't).  Thus,
  116.  
  117.                 burnout 5000 V-
  118.  
  119.         sets the program to reset to 5000 ticks, and not to monitor
  120.         video.  Why would you not want to monitor video?  Primarily
  121.         because some programs continuously update the display (e.g.,
  122.         with a ticking clock) even when they're not doing anything.  If
  123.         you set V+, the screen would never blank.  The powerup default
  124.         setting is V+. (V- is equivalent to the old "BURNOUT /K"
  125.         command).
  126.  
  127.         H: This stands for Hardware, and tells burnout whether you want
  128.         it to blank the screen by manipulating the hardware (i.e., by
  129.         turning off the video signal), or by software (which it does by
  130.         temporarily changing screen attributes to black-on-black, or
  131.         nondisplay).  Some explanation is in order.
  132.  
  133.         The preferred method of blanking the screen is to do it by
  134.         manipulating the PC's video controller.  This method is very
  135.         fast and in general has fewer problems than the software method.
  136.         However, it does have two problems.  First, it is nonportable:
  137.         it doesn't work with all PC-compatibles.  Second, there have
  138.         been reports that this method can PHYSICALLY DAMAGE a few
  139.         non-IBM video adapters, notably the Hercules monochrome graphics
  140.         adapter.
  141.  
  142.         DO NOT USE H+ IF YOU ARE USING A HERCULES VIDEO ADAPTER!!!  YOU
  143.         HAVE BEEN WARNED!!!
  144.  
  145.         If you are NOT using a Hercules card, try H+, with a setting of
  146.         about 10 seconds, to make sure it works:
  147.  
  148.                 burnout 180 H+
  149.  
  150.         The screen should blank in about 10 seconds.  If it does not,
  151.         you will have to use H- (which is the powerup default setting).
  152.         Reset burnout to some reasonable period of time, of course,
  153.         after you have tested.
  154.  
  155.         C: This stands for Continuous Clear.  If you are using H+, you
  156.         can skip this one, because it is ignored in hardware blanking
  157.         mode.  As mentioned above, software blanking is achieved by
  158.         simply changing all video attributes to nondisplay
  159.         (black-on-black).  Now, if you are running in V- mode (not
  160.         monitoring video), or if you are running a program which
  161.         achieves video output by writing data directly to screen memory,
  162.         new data will begin to appear on the screen, even though it is
  163.         blanked.  Continuous Clear attempts to remedy this by simply
  164.         resetting all the attributes to black-on-black every time the
  165.         clock ticks (18 times per second).  The new data will flash on
  166.         the screen and disappear immediately.  Powerup default is C-.
  167.         Note that C- is equivalent to the old "BURNOUT /N" command.
  168.  
  169.         The burnout parameters can be entered in any order; illegal
  170.         parameters, capitalization, and separators are ignored.  Thus,
  171.         the following are all equivalent:
  172.  
  173.                 burnout 5000 V+ H-
  174.                 burnout 5000,V+,H-
  175.                 burnout v+h-5000
  176.                 burnout H+, V-, 5000
  177.                 burnout 5000H-V+
  178.                 burnout h-5000v+
  179.  
  180.         If you enter a count greater than 65535, you're on your own.
  181.         You won't get what you expect.  If you don't like the way
  182.         BURNOUT.COM works, you're free to "roll your own"; see the next
  183.         section.
  184.  
  185.         When BURNOUT has completed, it will display the current device
  186.         status.  For example:
  187.  
  188.                 Status: 09994,10000, ,C-,V+,H+
  189.  
  190.         The format of the status line is:
  191.  
  192.                 Status: nnnnn,nnnnn,B,C+-,V+-,H+-
  193.  
  194.         The first number is the current number of clock ticks remaining
  195.         till the next screen blank; the second is the reset count (in
  196.         this case, the two numbers will be very close).  The "B", if
  197.         present, indicates that the screen is currently Blanked (you
  198.         won't see this after running BURNOUT).  The "C", "V", and "H"
  199.         flags indicate the current status of Continuous Clear, Video
  200.         monitoring, and Hardware clearing.  If the parameter is active,
  201.         the indicator will be followed by a plus sign (+), otherwise a
  202.         minus sign (-).  In the above example, then, the current count
  203.         is 09994, the reset count is 10000, the screen is not blanked
  204.         (naturally), Continous Clear is off, and Video monitoring and
  205.         Hardware clearing are on.
  206.  
  207.         Unspecified parameters are not changed; thus, if you run burnout
  208.         without any parameters, it will simply display status without
  209.         changing anything.
  210.  
  211.         You can also include any of these parameters in the config.sys
  212.         file so that they will be set immediately when you boot.  For
  213.         example,
  214.  
  215.                 device=burndev.sys 8000 H+ V-
  216.  
  217.  
  218.         Burnout command
  219.         ---------------
  220.         Burnout has one command, the "R" (reset) command.  When the
  221.         burnout device receives an R in its input stream, it performs
  222.         two actions: it restores the screen if it is current blanked,
  223.         and it resets the current count to the reset count.  The R
  224.         command's primary purpose is to allow other applications to
  225.         force a burnout device reset, as described below.
  226.  
  227.  
  228.         Using the BRNDEV device
  229.         -----------------------
  230.         As mentioned above, the screen blanker is implemented as a
  231.         virtual device.  The advantage to this is that it can be
  232.         interrogated or controlled very easily, from the DOS command
  233.         line or from your own programs.  In fact, BURNOUT.COM is a very
  234.         simple program which takes your command line parameters, sends
  235.         them to the burnout device, reads the current status back from
  236.         the device, and displays the results.  This section explains how
  237.         to do this.
  238.  
  239.         When DOS finds the "device=burndev.sys" line in config.sys, it
  240.         loads and installs the burndev.sys program as a virtual device.
  241.         What this means, practically speaking, is that there is now a
  242.         new "device" attached to your PC. You already have several
  243.         devices installed: CON, PRN, COM1 and COM2, AUX, your disk
  244.         drives, and possibly a RAM (or virtual) disk if you have
  245.         installed VDISK.SYS or another disk emulator.
  246.  
  247.         The new device is known to DOS by the name "BRNDEV" (note: this
  248.         is NOT "BURNDEV", it's "BRNDEV", no U). Like other devices, you
  249.         can write (send information) to the device, and you can read
  250.         (receive information) from the device.  BRNDEV is designed to
  251.         accept certain very specific information (the burnout
  252.         parameters) when it is written to, and to return certain very
  253.         specific information (the burnout status) when it is read from.
  254.  
  255.  
  256.         Writing to BRNDEV
  257.         -----------------
  258.         How do you "write" to BRNDEV?  There are many ways.  The
  259.         simplest is to do it right from the keyboard, at the DOS prompt:
  260.  
  261.                 copy con brndev<Enter>
  262.                 @8000 V-#<Enter>
  263.                 ^Z<Enter>
  264.  
  265.         The "copy con brndev" command instructs DOS that you want to
  266.         copy input from the console device to the BRNDEV device.  The
  267.         console input "@5000 V-#<Enter>" is copied to the burnout device
  268.         when you hit the Ctrl-Z (end of copy) and <Enter> (execute)
  269.         keys.  To prove it worked, type "burnout" and look at the new
  270.         parameters; they should reflect a reset count of 8000 and no
  271.         video monitoring.  (The significance of @ and # will be
  272.         explained shortly.)
  273.  
  274.         Another way to write to the device would be to copy a small
  275.         textfile to BRNDEV.  As an example, type
  276.  
  277.                 copy con brndemo.txt<Enter>
  278.                 @10000V+#<Enter>
  279.                 ^Z<Enter>
  280.  
  281.         You should now have a small textfile, the contents of which are
  282.         "@10000V+#".  To sen it to BRNDEV, just type
  283.  
  284.                 copy brndemo.txt brndev
  285.                         or
  286.                 type brndemo.txt > brndev
  287.  
  288.         Run burnout to prove that the parameters have changed.
  289.  
  290.         The purpose of the "@" at the beginning of the output to BRNDEV
  291.         is to tell the device to flush or rewind its I/O buffers.
  292.         BRNDEV just sees a sequence of characters coming from DOS; it
  293.         has no particular way to know when it is getting a new sequence
  294.         of command characters.  The "@" tells it to get rid of any old,
  295.         leftover junk and to start fresh.  Make a habit of prefixing all
  296.         BRNDEV commands with an @ symbol.  "@" also has a second
  297.         purpose, which will be covered below.
  298.  
  299.         The "#" is the "execute" character.  It tells BRNDEV that it has
  300.         received the whole parameter list.  Only when BRNDEV sees the #
  301.         will it examine the parameter list and execute the commands.
  302.         Thus, "#" should be at the end of all BRNDEV commands; something
  303.         like "@5000 C+H-" will have no effect at all.  The one exception
  304.         is that it is NOT necessary to send a "#" to execute a "@".
  305.         That is, the "@" is a live character; it is not buffered for
  306.         later execution.
  307.  
  308.         It is also possible, of course, to send commands to BRNDEV from
  309.         high level languages or from assembler programs.  Here's a BASIC
  310.         example:
  311.  
  312.                 10 OPEN "BRNDEV" FOR OUTPUT AS #1
  313.                 20 PRINT #1, "@5000 C+ H-#";
  314.                 30 CLOSE 1
  315.  
  316.         And C (this is C86); you'd want to add some error detection:
  317.  
  318.                 {
  319.                 FILE *burnout, *fopen();
  320.                 static char command[] = "@5000 C+ H-#";
  321.  
  322.                         burnout = fopen("BRNDEV","w");
  323.                         fwrite(command, 1, strlen(command), burnout);
  324.                         fclose(burnout);
  325.                 }
  326.  
  327.         For an 8086 assembler example, see the source for BURNOUT.COM
  328.         (BURNOUT.ASM), which is included in the burnout library.
  329.         Basically, you have to open the device (filename=BRNDEV, fomode
  330.         0 or 2), and use function 40H (FWRITE) to write bytes to the
  331.         device using the returned handle.
  332.  
  333.         Note that application programs can use the R command to force a
  334.         burnout device reset:
  335.  
  336.                 1000 ' SUBROUTINE TO RESET BURNOUT AND RESTORE SCREEN
  337.                 1010 OPEN "BRNDEV" FOR OUTPUT AS #1
  338.                 1020 PRINT #1,"@R#";
  339.                 1030 CLOSE 1
  340.                 1040 RETURN
  341.  
  342.  
  343.         Reading from BRNDEV
  344.         -------------------
  345.  
  346.         Unfortunately, reading from BRNDEV is not quite as simple as
  347.         writing to it.  There's no way that I can think of to do it from
  348.         the command line; you really need a program (I suppose you could
  349.         CTTY BRNDEV and then reboot when the machine went crazy [just
  350.         kidding, don't try it]).  Also, there is a bug in DOS 2.x which
  351.         prevents you from using BASIC for this purpose (fixed under 3.0,
  352.         however).  Under 3.0, the BASIC program would be:
  353.  
  354.                 10 OPEN "BRNDEV" FOR OUTPUT AS #1
  355.                 20 PRINT #1, "@";      ' Note "#" not necessary here
  356.                 30 CLOSE 1
  357.                 40 OPEN "BRNDEV" FOR INPUT AS #1
  358.                 50 BSTAT$ = INPUT$(22,1)
  359.                 60 CLOSE 1
  360.                 70 PRINT "Burnout status is "; BSTAT$
  361.  
  362.         Note that we always write an "@" to the device before reading
  363.         its status.  The @'s function is described as above, to flush
  364.         any unfinished I/O from BRNDEV's buffers.  Of considerable
  365.         importance here, however, is that the @ also tells BRNDEV to
  366.         prepare for a status request.  When BRNDEV sees the @, it
  367.         examines its current status and puts the data into a buffer,
  368.         from which it will be retrieved when it gets the request.
  369.         Without the preparatory @, you'll get old data.
  370.  
  371.         The significance of the "22" in the INPUT$ statement is that the
  372.         BRNDEV status report is 22 characters long.
  373.  
  374.         Here's a C example:
  375.  
  376.                 {
  377.                 FILE *burnout, *fopen();
  378.                 static char command[] = "@";
  379.                 char status[30];
  380.  
  381.                         burnout = fopen("BRNDEV","rw");
  382.                         fwrite(command, 1, strlen(command), burnout);
  383.                         fread (status, 1, 255, burnout);
  384.                         fclose(burnout);
  385.                         printf("Burnout status is %s\n", status);
  386.                 }
  387.  
  388.         Note that we requested 255 characters.  DOS, in general, will
  389.         halt a device read when it encounters a carriage return from the
  390.         input stream.  BRNDEV makes a habit of sending a CR after the
  391.         last byte of the status report, so this will terminate the read
  392.         automatically; no need to worry about the true length of the
  393.         report.  BASIC, however, will just keep reading until it
  394.         accumulates the requested number of characters, so you do have
  395.         to be watchful there.  The same trick (requesting too many
  396.         characters) will also work in assembler programs (again, see
  397.         BURNOUT.ASM).
  398.  
  399.         Now, about that bug in DOS 2.x.  It turns out that DOS will mess
  400.         up if you ever request a single byte from an installed character
  401.         device, which is what BRNDEV is.  (Technically: EOF is set on
  402.         the device, and you will not be able to do any further reads
  403.         unless you mess with IOCTL and explicitly reset EOF.)  Thus, the
  404.         following assembler code will NOT work under 2.x:
  405.  
  406.                 mov cx,22         ; Loop for 22 bytes
  407.         Label:
  408.                 push cx           ; Save loop count
  409.                 mov ah,3FH        ; Read from file
  410.                 mov bx,BHandle    ; BRNDEV file handle (from FOPEN)
  411.                 mov cx,1          ; One byte at a time
  412.                 mov dx,offset buf ; Where to put the data
  413.                 int 21H           ; Perform read
  414.                 (do something with the byte)
  415.                 pop cx            ; Recover loop count
  416.                 loop label        ; Loop till 19 bytes read
  417.  
  418.         The first byte will be read OK, but no further input will be
  419.         received.  You MUST read at least 2 bytes at a time.
  420.  
  421.         This bug can be overcome in assembler and C by simply requesting
  422.         the full status report in one read.  However, it appears that
  423.         BASIC requests only one byte at a time, even if you use
  424.         something like INPUT$(22,n).  Reading the second byte then
  425.         results in a READ PAST EOF error.
  426.  
  427.  
  428.         Tricks
  429.         ------
  430.         You can do neat stuff like waiting for the screen to burn out,
  431.         then turning it back on:
  432.  
  433.                 1  REM DEMO PROGRAM TO WAIT UNTIL SCREEN BLANKS
  434.                 2  REM
  435.                 10 OPEN "BRNDEV" FOR OUTPUT AS #1
  436.                 20 OPEN "BRNDEV" FOR INPUT AS #2
  437.                 30 WHILE NOT BURNED.OUT
  438.                 40    PRINT #1,"@";
  439.                 50    A$ = INPUT$(22,2)
  440.                 60    BURNED.OUT = (MID$(A$,13,1) = "B")
  441.                 70 WEND
  442.                 80 BEEP: PRINT "Burned out!"
  443.                 90 CLOSE 1: CLOSE 2
  444.  
  445.         The 13th character of the status report, "B", will appear in the
  446.         report only when the screen is blanked.
  447.  
  448.         Also, your programs can cancel burnout totally, if desired:
  449.  
  450.                 1  REM DEMO PROGRAM TO DISABLE BURNOUT
  451.                 2  REM
  452.                 10 OPEN "BRNDEV" FOR OUTPUT AS #1
  453.                 20 PRINT #1,"@0#";
  454.                 30 CLOSE 1
  455.  
  456.         (I am not a BASIC programmer, so if any of these demo BASIC
  457.         programs are dumb, someone tell me.)
  458.  
  459.         Naturally, it would be possible (and friendly) to read in the
  460.         burnout parameters, modify them while your program is running,
  461.         and restore the original parameters when you are done.
  462.  
  463.         If you use Seaware's Extended Batch Language, you can even test
  464.         whether or not BRNDEV is installed from within a batch:
  465.  
  466.                 bat stateof BRNDEV
  467.                 bat if %r = 0 type BURNOUT IS INSTALLED | goto -A1
  468.                 bat type BURNOUT IS NOT INSTALLED
  469.                 bat -A1
  470.  
  471.         If you have a one-floppy machine, you can trick DOS and BAT into
  472.         not checking the second logical drive (and stopping the batch to
  473.         ask you to "Insert diskette for drive B") by using
  474.  
  475.                 bat stateof A:BRNDEV
  476.  
  477.         DOS apparently doesn't care if you prefix a device name with a
  478.         drive ID.
  479.  
  480.  
  481.         Incompatibilities and Problems
  482.         ------------------------------
  483.         I am aware of only a few problems and interactions with other
  484.         programs.  In order for burnout to "see" keyboard and video
  485.         activity, active programs must use ROM BIOS (or DOS, which
  486.         itself uses BIOS) for their keyboard input and video output.
  487.         A few progams use neither; hence burnout never sees their
  488.         activity, and the screen will be irrevocably blanked.  These
  489.         programs are mostly word processors; two that I know of are
  490.         XYWrite and WordVision.  You must disable burnout before using
  491.         either of these ("BURNOUT 0" will do the trick).  Most people do
  492.         this in a batch:
  493.  
  494.                 burnout 0
  495.                 wv
  496.                 burnout 10000
  497.  
  498.         There are also problems with some communications programs if you
  499.         use software blanking.  If you are performing an extended length
  500.         file transfer the screen may blank during the transfer.
  501.         Software blanking takes a little time, and communications input
  502.         can be lost while it is being accomplished.  This, of course,
  503.         messes up the transfer.  And Continuous Clear is even worse.
  504.         The solution is either to use hardware blanking or to disable
  505.         burnout while transfers are taking place.  You MAY be able to
  506.         get away with leaving burnout enabled, but disabling Continuous
  507.         Clear (C-).
  508.  
  509.         Note that the word "BRNDEV" becomes a reserved word to DOS.  You
  510.         cannot name any file BRNDEV (or even BRNDEV.TXT, or whatever).
  511.         DOS won't let you do that.  If you do succeed, you won't be able
  512.         to erase it.  This is why the driver is stored in a file named
  513.         BURNDEV.SYS rather than BRNDEV.SYS.
  514.  
  515.  
  516.         Tick chart
  517.         ----------
  518.         To save wear and tear on your calculator, here are some
  519.         approximate tick counts:
  520.  
  521.                 Minutes   Count
  522.                 -------   -----
  523.                    1       1100
  524.                    2       2200
  525.                    3       3275
  526.                    4       4375
  527.                    5       5450
  528.                    6       6550
  529.                    7       7650
  530.                    8       8725
  531.                    9       9825
  532.                   10      10920
  533.                   20      21850
  534.                   30      32760
  535.                   40      43680
  536.                   50      54600
  537.                   60      65520
  538.  
  539.  
  540.  
  541.         The Usual Suspects
  542.         ------------------
  543.         The author accepts no responsibility for this software
  544.         whatsoever.  It might work, it might not.  In particular, he
  545.         accepts no responsibility for any result of the use of the
  546.         software, even if it results in damage to your hardware.
  547.  
  548.         The burnout device driver (BURNDEV.SYS) and all demonstration
  549.         programs are placed in the public domain and may be freely used
  550.         by any individual.  You may not use them commercially.  You may
  551.         copy and distribute the software and documentation to any other
  552.         individual, PROVIDED that you do not charge for this.
  553.         Recognized users' groups may, however, charge a small fee for
  554.         postage and materials.
  555.  
  556.         I am interested in comments or suggestions on the usability of
  557.         the burnout system, especially by programmers.  Contact me via
  558.         CompuServe if possible.
  559.  
  560.  
  561.                       All software and documentation are
  562.  
  563.                              Copyright (c) 1985 by
  564.                             Christopher J. Dunford
  565.                            10057-2 WIndstream Drive
  566.                            Columbia, Maryland 21044
  567.                            CompuServe ID 76703,2002
  568.